<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			/* 利用 display：flex;设置垂直水平都居中 */
			.parent {
				width: 500px;
				height: 500px;
				border: 1px solid #FFFF00;
				display: flex;
				justify-content: center;
				align-items: center;
			}

			.child {
				width: 100px;
				height: 100px;
				border: 1px solid #999;
			}
		</style>
	</head>
	<body>
		<div class="parent">
			<div class="child"></div>
		</div>
	</body>
</html>
